<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>r
<script>
    function Foo(who){
        this.me = who;
    }
    Foo.prototype.identify = function(){
        return "I am" + this.me;
    }
    function Bar(who){
        Foo.call(this,who)
    }

    Bar.prototype = Object.create(Foo.prototype)

    Bar.prototype.speak = function(){
        alert("Hello" + this.identify() + '.')
    }
    var b1 = new Bar("b1")
    var b2 = new Bar("b2")
    b1.speak();
    b2.speak();
    //子类Bar继承了父类Foo 然后生成了b1和b2两个实例 
    // b1委托了Bar.prototype 后者委托了Foo.prototype
  m,,,,


</script>
</html>